Embodiments of the present invention relate to data processing in a computer system, and more particularly to resolving a lock situation in a system.
Typical systems designed today are complex systems that include multiple processing engines, such as multiprocessor systems, multicore processors, and the like. Furthermore, multiple threads or blocks can be processed simultaneously in one or more processors of the system. Accordingly, the operation and synchronization of different portions of a system are becoming more involved.
One problem that arises as a result of the increased complexity of computing systems is a lock situation. Such a situation occurs when multiple blocks desire to use the same resource. Such blocks may be different software threads, different system components or the like, and similarly, the resources competed for may be hardware resources of a processor or other system components, or data owned by a system agent.
When multiple blocks of a system compete for ownership of a resource, performance can be negatively affected. In one scenario, at least one block cannot make forward progress until it is able to obtain ownership of the resource. In an even more serious scenario, neither of an owning system block and a requesting system block can make forward progress as the requesting block consumes the owning block with requests for ownership or similar requests. Other examples of a lock situation are when two blocks wait for each other to release an occupied resource.
A mutual lock situation may be of different types, including a so-called “live” lock situation or a so-called “dead” lock situation. In a live lock situation, one or more blocks is highly active in attempting to gain ownership of the desired resource. In such a situation, the owner block may find it very difficult to make forward progress with its task as repeated requests for ownership are received from the requesting block. In a dead lock situation, one or more blocks may simply be in a wait state, waiting for a desired resource. However, during this wait state, the block does not perform any useful work.
During both design and validation stages, efforts are made to avoid such lock situations. However, in light of the complexity of modem systems, lock situations continue to occur. A typical manner of attempting to resolve a lock situation is for a system to detect the presence of a lock situation and try to break the lock. While often successful, this approach demands prediction of the areas where the lock can happen. Such lock detection or prediction functionality can consume significant hardware and/or processing capabilities. Accordingly, a need exists for an improved manner of resolving lock situations.